package com.stlm2.ueditor;


import com.stlm2.core.AppConfig;
import org.apache.commons.lang.StringUtils;

public class Image {

    //允许的图片格式
    public static String ALLOW_EXT = ".png.jpg.jpeg.gif.bmp";

    public static final String IMAGE_RESOURCE = "image/";

    public static String getImageResDir() {
        return getRet() + AppConfig.RESOURCE_APP_ROOT + IMAGE_RESOURCE;
    }

    public static String getRet(){
        String ret = AppConfig.getResourceHome();

        String contextPath = AppConfig.getContextPath();
        if (!contextPath.equals("/") && ret.contains(contextPath))
            ret = ret.substring(0, ret.indexOf(contextPath));
        return ret;
    }

    //---------查询参数-------
    private transient Boolean original;

    public Boolean getOriginal() {
        return original;
    }

    public void setOriginal(Boolean original) {
        this.original = original;
    }

}
